home *** CD-ROM | disk | FTP | other *** search
/ AMOS PD CD / amospdcd.iso / sourcecode / general / sketch pad.amos / sketch pad.amosSourceCode
Encoding:
AMOS Source Code  |  1992-06-05  |  4.3 KB  |  240 lines

  1. '                          (c) 1990 Gary Shilvock
  2. '
  3. '    A Simple Drawing Program Designed To Keep Young Kids Amused 
  4. '
  5. HELPSCREEN
  6. _START:
  7. Screen Open 0,320,256,16,Lowres
  8. Flash Off 
  9. Cls 0
  10. Restore _COL
  11. For A=0 To 15
  12.    Read CL
  13.    Palette A,CL
  14. Next 
  15. _COL:
  16. Data $0,$FFF,$F00,$F0,$F,$F0F,$FF,$555,$FAC,$357,$A0A,$419,$984,$238,$831,$438
  17. Colour 0,0
  18. Cls 0
  19. Change Mouse 2
  20. XLEN=8
  21. YLEN=8
  22. IN=1
  23. Do 
  24.    X=X Screen(X Mouse)
  25.    Y=Y Screen(Y Mouse)
  26.    If Mouse Key=1
  27.       Ink IN
  28.       If XLEN=0
  29.          Plot X,Y
  30.       End If 
  31.       If XLEN>0
  32.          Bar X,Y To X+XLEN,Y+YLEN
  33.       End If 
  34.    End If 
  35.    If Mouse Key=2
  36.       Ink 0
  37.       If XLEN=0
  38.          Plot X,Y
  39.       End If 
  40.       If XLEN>0
  41.          Bar X,Y To X+XLEN,Y+YLEN
  42.       End If 
  43.    End If 
  44.    K$=Inkey$
  45.    If K$="="
  46.       Bell 
  47.       If XLEN>31
  48.          XLEN=31
  49.          YLEN=31
  50.       End If 
  51.       XLEN=XLEN+1
  52.       YLEN=YLEN+1
  53.    End If 
  54.    If K$="-"
  55.       Bell 
  56.       XLEN=XLEN-1
  57.       YLEN=YLEN-1
  58.       If XLEN<0
  59.          XLEN=0
  60.          YLEN=0
  61.       End If 
  62.    End If 
  63.    If K$="]"
  64.       Bell 
  65.       IN=IN+1
  66.       If IN=15
  67.          IN=0
  68.       End If 
  69.    End If 
  70.    If K$="["
  71.       Bell 
  72.       IN=IN-1
  73.       If IN=0
  74.          IN=15
  75.       End If 
  76.    End If 
  77.    If K$="1"
  78.       Bell 
  79.       Set Pattern 1
  80.    End If 
  81.    If K$="2"
  82.       Bell 
  83.       Set Pattern 2
  84.    End If 
  85.    If K$="3"
  86.       Bell 
  87.       Set Pattern 3
  88.    End If 
  89.    If K$="4"
  90.       Bell 
  91.       Set Pattern 4
  92.    End If 
  93.    If K$="5"
  94.       Bell 
  95.       Set Pattern 5
  96.    End If 
  97.    If K$="6"
  98.       Bell 
  99.       Set Pattern 6
  100.    End If 
  101.    If K$="7"
  102.       Bell 
  103.       Set Pattern 7
  104.    End If 
  105.    If K$="8"
  106.       Bell 
  107.       Set Pattern 8
  108.    End If 
  109.    If K$="9"
  110.       Bell 
  111.       Set Pattern 9
  112.    End If 
  113.    If K$="0"
  114.       Bell 
  115.       Set Pattern 0
  116.    End If 
  117.    If K$=" "
  118.       Bell 
  119.       Cls 0
  120.    End If 
  121.    If K$="."
  122.       Bell 
  123.       XLEN=0
  124.       YLEN=0
  125.    End If 
  126.    If K$="s"
  127.       Screen Open 1,640,30,2,Hires
  128.       Screen To Front 1 : Screen 1
  129.       Palette $0,$FFF
  130.       Input "Enter Save Name: ";SAVNAM$
  131.       If SAVNAM$=""
  132.          SAVNAM$="Picture"
  133.       End If 
  134.       Screen Close 1
  135.       TMP$="Df0:"
  136.       TMP$=TMP$+SAVNAM$
  137.       THERE=Exist(TMP$)
  138.       If THERE=0
  139.          Save Iff TMP$,0
  140.          Bell 
  141.       End If 
  142.       If THERE=-1
  143.          TMP$="Df0:"
  144.          TMP$=TMP$+SAVNAM$
  145.          Kill TMP$
  146.          Save Iff TMP$,0
  147.          Bell 
  148.       End If 
  149.    End If 
  150.    If K$="l"
  151.       NAME$=Fsel$("Df0:","","Choose Picture To Load.","")
  152.       If NAME$=""
  153.          Goto CONTINUE
  154.       End If 
  155.       Load Iff NAME$,0
  156.    End If 
  157.    CONTINUE:
  158.    If K$="h"
  159.       HELPSCREEN
  160.    End If 
  161.    If K$="t"
  162.       Screen Open 1,640,8,2,Hires : Palette $357,$FFF : Cls 0 : Hide 
  163.       Input "Enter Text: ";TXT$
  164.       Screen Close 1
  165.       Ink IN,0,0
  166.       Text X,Y,TXT$
  167.       Show 
  168.    End If 
  169.    If K$="f"
  170.       Ink IN
  171.       Paint X,Y,0
  172.    End If 
  173.    If K$="i"
  174.       Screen Open 1,640,8,2,Hires : Palette $35,$FFF
  175.       Cls 0
  176.       TMP$="Ink: "
  177.       TMP$=TMP$+Str$(IN)
  178.       TMP$=TMP$+"   Brush Size: "
  179.       TMP$=TMP$+Str$(XLEN)
  180.       TMP$=TMP$+" x "
  181.       TMP$=TMP$+Str$(YLEN)
  182.       Text 0,6,TMP$
  183.       Screen Display 1,132,0,,
  184.       For DN=30 To 45
  185.          Screen Display 1,132,DN,,
  186.          Wait Vbl 
  187.       Next 
  188.       Wait 100
  189.       For DN=45 To 30 Step -1
  190.          Screen Display 1,132,DN,,
  191.          Wait Vbl 
  192.       Next 
  193.       Screen Close 1
  194.    End If 
  195.    If K$=""
  196.    End If 
  197.    If K$=""
  198.    End If 
  199. Loop 
  200. Procedure HELPSCREEN
  201.    Screen Open 1,640,256,2,Hires
  202.    Palette $35,$FFF : Cls 0
  203.    Hide : Curs Off 
  204.    For A=0 To 26
  205.       Locate 0,A
  206.       Read TMP$
  207.       Centre TMP$
  208.    Next 
  209.    Wait Key 
  210.    Fade 1 : Wait 15
  211.    Screen Close 1
  212.    Data "Sketch Pad Help Screen"
  213.    Data "----------------------"
  214.    Data " "
  215.    Data "Coded By Gary Shilvock (c) 1990"
  216.    Data " "
  217.    Data " "
  218.    Data "Keys"
  219.    Data "----"
  220.    Data " "
  221.    Data "+     Increase Brush Size         -     Decrease Brush Size "
  222.    Data "[     Previous Colour             ]     Next Colour         "
  223.    Data "L     Load Iff Screen             S     Save Iff Screen     "
  224.    Data "T     Place Text At Cursor Pos    F     Fill                "
  225.    Data "I     Info Screen                 Space Clear Screen        "
  226.    Data " "
  227.    Data " "
  228.    Data "Keys 1 To 0 For Different Brush Patterns."
  229.    Data " "
  230.    Data " "
  231.    Data " "
  232.    Data " "
  233.    Data " "
  234.    Data " "
  235.    Data " "
  236.    Data " "
  237.    Data " "
  238.    Data "Press Any Key To Return To Sketch Pad."
  239.    Show 
  240. End Proc